﻿using System.Configuration;
using System.Reflection;
using System.Diagnostics;

namespace JetBlack.SimpleTopicBus.Distributor
{
    /// <summary>
    /// The environment for the application.
    /// </summary>
    public static class AppEnvironment
    {
        /// <summary>
        /// The <see cref="TraceSource"/> used by the application for logging.
        /// </summary>
        readonly static public TraceSource TraceSource = new TraceSource("JetBlack.SimpleTopicBus.Distributor");

        readonly private static Config.Handler configuration = (Config.Handler)ConfigurationManager.GetSection("simpleTopicBusDistributor");

        /// <summary>
        /// The configuration of the distributor.
        /// </summary>
        public static Config.Adapter Configuration
        {
            get { return configuration.DefaultConfig; }
        }
    }
}
